package com.scau402.system.service.impl;

import java.util.List;
import com.scau402.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scau402.system.mapper.WmsStreamScheduleMapper;
import com.scau402.system.domain.WmsStreamSchedule;
import com.scau402.system.service.IWmsStreamScheduleService;

/**
 * 直播排班记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class WmsStreamScheduleServiceImpl implements IWmsStreamScheduleService 
{
    @Autowired
    private WmsStreamScheduleMapper wmsStreamScheduleMapper;

    /**
     * 查询直播排班记录
     * 
     * @param id 直播排班记录主键
     * @return 直播排班记录
     */
    @Override
    public WmsStreamSchedule selectWmsStreamScheduleById(Long id)
    {
        return wmsStreamScheduleMapper.selectWmsStreamScheduleById(id);
    }

    /**
     * 查询直播排班记录列表
     * 
     * @param wmsStreamSchedule 直播排班记录
     * @return 直播排班记录
     */
    @Override
    public List<WmsStreamSchedule> selectWmsStreamScheduleList(WmsStreamSchedule wmsStreamSchedule)
    {
        return wmsStreamScheduleMapper.selectWmsStreamScheduleList(wmsStreamSchedule);
    }

    /**
     * 新增直播排班记录
     * 
     * @param wmsStreamSchedule 直播排班记录
     * @return 结果
     */
    @Override
    public int insertWmsStreamSchedule(WmsStreamSchedule wmsStreamSchedule)
    {
        wmsStreamSchedule.setCreateTime(DateUtils.getNowDate());
        wmsStreamSchedule.setStartTime(DateUtils.addHour(wmsStreamSchedule.getStartTime(), -8));
        wmsStreamSchedule.setEndTime(DateUtils.addHour(wmsStreamSchedule.getEndTime(), -8));
        return wmsStreamScheduleMapper.insertWmsStreamSchedule(wmsStreamSchedule);
    }

    /**
     * 修改直播排班记录
     * 
     * @param wmsStreamSchedule 直播排班记录
     * @return 结果
     */
    @Override
    public int updateWmsStreamSchedule(WmsStreamSchedule wmsStreamSchedule)
    {
        wmsStreamSchedule.setUpdateTime(DateUtils.getNowDate());
        return wmsStreamScheduleMapper.updateWmsStreamSchedule(wmsStreamSchedule);
    }

    /**
     * 批量删除直播排班记录
     * 
     * @param ids 需要删除的直播排班记录主键
     * @return 结果
     */
    @Override
    public int deleteWmsStreamScheduleByIds(Long[] ids)
    {
        return wmsStreamScheduleMapper.deleteWmsStreamScheduleByIds(ids);
    }

    /**
     * 删除直播排班记录信息
     * 
     * @param id 直播排班记录主键
     * @return 结果
     */
    @Override
    public int deleteWmsStreamScheduleById(Long id)
    {
        return wmsStreamScheduleMapper.deleteWmsStreamScheduleById(id);
    }
}
